Skip to content

Replace Enums with string literals#4

Merged
Thematiq merged 4 commits intomasterfrom
refactor/drop_enums
Feb 24, 2026
Merged

Replace Enums with string literals#4
Thematiq merged 4 commits intomasterfrom
refactor/drop_enums

Conversation

@Thematiq
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request replaces Enum-based parameter types with Literal type hints, transitioning from HyperPrior, ReportedProperty, and TieSolver enums to string literals. The change aims to simplify the API by using plain strings instead of enum values, while maintaining type safety through Literal annotations and runtime validation.

Changes:

  • Removed HyperPrior, ReportedProperty, and TieSolver enums from the public API
  • Introduced new Literal type definitions (HyperPriorType, TieSolverType, ReportedPropertyColumnType) in _types.py
  • Added parameter validation decorator and distribution helper in _utils.py
  • Updated all code and tests to use string literals instead of enum values

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
bbttest/bbt/_types.py New file defining Literal types for parameters and column names
bbttest/bbt/_utils.py New file with parameter validation decorator and distribution factory function
bbttest/bbt/py_bbt.py Updated to use Literal types, removed enum conversions, improved docstring formatting
bbttest/bbt/model.py Updated to use string parameter instead of HyperPrior enum
bbttest/bbt/alg.py Updated to use string parameter instead of TieSolver enum
bbttest/bbt/params.py Deleted file containing enum definitions
bbttest/bbt/init.py Removed enum exports, only exports PyBBT
bbttest/init.py Removed enum exports, only exports PyBBT
tests/bbt/test_py_bbt.py Updated tests to use string literals, removed parametrized enum tests
tests/bbt/test_alg.py Updated to use string literals for tie_solver
tests/regression/test_benchmarking_mol.py Updated to use string literals and simplified column specification
Makefile Renamed target from full-test to test-all
.gitignore Added .DS_Store exclusion

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Thematiq Thematiq merged commit 5ab8eb8 into master Feb 24, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants